load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "sqltestutils",
    testonly = 1,
    srcs = [
        "large_schema.go",
        "show_create_table.go",
        "sql_test_utils.go",
        "telemetry.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/sqltestutils",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/config/zonepb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/roachpb",
        "//pkg/server",
        "//pkg/server/diagnostics",
        "//pkg/sql",
        "//pkg/sql/appstatspb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/parser",
        "//pkg/sql/parser/statements",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sqlstats/persistedsqlstats",
        "//pkg/testutils",
        "//pkg/testutils/diagutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/util",
        "//pkg/util/cloudinfo",
        "//pkg/util/protoutil",
        "//pkg/util/treeprinter",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_jackc_pgx_v4//:pgx",
        "@com_github_lib_pq//:pq",
        "@com_github_stretchr_testify//require",
    ],
)

go_test(
    name = "sqltestutils_test",
    srcs = ["large_schema_test.go"],
    data = glob(["testdata/**"]),
    embed = [":sqltestutils"],
    deps = [
        "//pkg/testutils/datapathutils",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_stretchr_testify//require",
    ],
)
